<template>
  <div style="width: 100%; height: 100%">
    <dv-scroll-board :config="config" />
  </div>
</template>
<script>
import { getJysjByMarketATy } from "../util/home";
export default {
  name: "",
  components: {},
  data() {
    return {
      config: {},
      header: [`<span style="font-size:10px">摊位号</span>`, `<span style="font-size:10px">商品名称</span>`, `<span style="font-size:8px">交易数量(kg)</span>`, `<span style="font-size:10px">交易时间</span>`, `<span style="font-size:10px">商品来源</span>`],

      data: [],
    };
  },

  created() {
    // this.getCityData();
  },
  inject: ["currentMarketId"],
  methods: {
    getCityData() {
      getJysjByMarketATy({ marketId: this.currentMarketId() }).then((res) => {
        this.data = [];
        let array = res.data.data;
        array.forEach((item) => {
          let arr = [];
          arr[0] = `<span style="font-size:8px">${item.twhname}</span>`;
          arr[1] = `<span style="font-size:8px">${item.name}</span>`;
          arr[2] = `<span style="font-size:8px">${item.jhsum}</span>`;
          arr[3] = `<span style="font-size:8px">${item.timety}</span>`;
          arr[4] = `<span style="font-size:8px">${item.comeaddress}</span>`;
          this.data.push(arr);
        });
        this.config = {
          header: this.header,
          headerBGC: "none",
          oddRowBGC: "#17325B",
          evenRowBGC: "#0C1B48",
          columnWidth: ["50"],
          data: this.data,
          align: ["center", "center", "center", "center", "center"],
        };
      });
    },
  },
};
</script>
<style lang="less">
.home-container .content .item-box .item .dv-scroll-board .header .header-item {
  color: #0fffff;
  font-size: 14px;
}

.dv-scroll-board {
  width: 100% !important;
  height: 100% !important;
}
</style>
